package com.yunfei.api.v2.service;
import com.yunfei.api.v2.common.YunHeTongApiContant;
import com.yunfei.api.v2.param.LongTokenParam;
import com.yunfei.api.v2.param.ReserveNoParam;
import com.yunfei.api.v2.param.heTongDownLoad.HeTongDownLoadParam;
import com.yunfei.api.v2.result.heTongFuJian.ContractFile;
import com.yunfei.bo.result.ResultModel;
import com.yunfei.enums.ResultStatus;
import com.yunfei.mapper.aiiidb.ContractFileMapper;
import com.yunfei.utils.http.DownLoadContractHttpUtil;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
* @Description: 合同附件的上传
* @Author: zhengyunfei
* @Date: 2019/8/27
* @time:10:52
*/
@Service
public class UploadContractFileService {
    @Autowired
    private ContractFileMapper contractFileMapper;
    public ResultModel sign(ReserveNoParam param){
        ResultModel resultModel=new ResultModel();
        try{
            Map<String,Object> queryMap=new HashMap<>();
            String reserveNo=param.getReserveNo();//预约编号
            queryMap.put("reserveNo",reserveNo);
            String cSubkeyId=contractFileMapper.getSubkeyId(queryMap);
            //获取需要上传的缴款信息
            Map<String,Object> contractFileQueryMap=new HashMap<>();
            contractFileQueryMap.put("cSubkeyId",cSubkeyId);
            List<ContractFile> list=contractFileMapper.list(contractFileQueryMap);
            resultModel.setCode(ResultStatus.SUCCESS.getCode());
            resultModel.setMessage(ResultStatus.SUCCESS.getMessage());
        }catch (Exception e){
            resultModel.setCode(ResultStatus.ERROR.getCode());
            resultModel.setMessage(ResultStatus.ERROR.getMessage());
            e.printStackTrace();
        }
        return resultModel;
    }


}
